import axios from '@/request'
import { queryParams } from '@/utils'

export function createUserApi(data) {
    return axios.post("/admin/user", data)
}

export function updateUserApi(id, data) {
    return axios.post("/admin/user/" + id, data)
}

export function getUserListApi(page, query = {}) {
    let q = queryParams(query, true)
    return axios.get(`/admin/user/${page}${q}`)
}

export function updateUserStatusApi(id, status) {
    return axios.post(`/admin/user/${id}/update_status`, { status })
}

export function deleteUserApi(ids) {
    return axios.post(`/admin/user/${ids[0]}/delete`)
}